package com.demo0302.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/demo0302/demo03.do")
public class Demo03Servlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("Demo03 中获取请求参数：" + request.getQueryString());
        System.out.println(request);
        System.out.println("Demo03 中读出 demo01Key = " + request.getAttribute("demo01Key"));
        System.out.println("Demo03 中读出 demo02Key = " + request.getAttribute("demo02Key"));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
